package cc.vv.btpartyjob.partymanager.delegate

import android.widget.EditText
import cc.vv.baselibrary.view.BaseTopBarView
import cc.vv.btpartyjob.partymanager.R
import cc.vv.btpartyjob.partymanager.view.AddSelectedFileShowView
import cc.vv.mvp.delegate.BaseAppDelegate
import com.dawning.utiming.task.bean.FileUrlObj
import com.dawning.utiming.task.inter.SelectedOrDeleteFileInterface

/**
 * 添加工作情况托管类
 * Created by Chen.qi on 2018/10/27.
 */
class AddWorkQingKuangActivityDelegate : BaseAppDelegate() {

    override fun initWidget() {

    }

    override fun initLayoutRes(): Int {
        return R.layout.activity_add_work_qingkuang
    }

    /**设置标题title*/
    fun setTopBarTitle(topBarTitle: String) {
        val titleBar = getView<BaseTopBarView>(R.id.btv_adwQK_topBar)
        titleBar?.setTitle(topBarTitle)
    }


    /**设置标题右边按钮点击事件*/
    fun setTitleBackBtnOnClick(event: BaseTopBarView.EventInterface) {
        val titleBar = getView<BaseTopBarView>(R.id.btv_adwQK_topBar)
        titleBar?.setEventInterface(event)
    }

    /**
     * 自定义控件设置接口
     */
    fun setSelectedFileInterface(deletedSelectedImageInter: SelectedOrDeleteFileInterface) {
        getView<AddSelectedFileShowView>(R.id.sfs_adwQK_pic)?.setDeletedSelectedImageInter(deletedSelectedImageInter)
    }

    /**
     * 设置数据
     */
    fun setSelectedFileObj(saltedDataList: ArrayList<FileUrlObj>?) {
        getView<AddSelectedFileShowView>(R.id.sfs_adwQK_pic)?.addAllSelectedFileView(saltedDataList, 3)
    }

    /**
     * 获取活动内容
     */
    fun getContent(): String {
        val view = getView<EditText>(R.id.et_adwQK_content)
        return view?.text.toString().trim()
    }

    /**
     * 获取主题
     */
    fun getZhuTi(): String {
        val view = getView<EditText>(R.id.et_adwQK_zhuti)
        return view?.text.toString().trim()
    }


}